#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5;
ll n,r[N],jiyu[N];
vector<ll> hc;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>r[i];
        jiyu[r[i]]++;
    }
    for(int i=1;i<=100000;i++){
        if(jiyu[i]){
            hc.push_back(jiyu[i]);
        }
    }
    ll cz=0,i=0,v=0;
    while(i<hc.size()&&v<hc.size()){
        while(hc[v]==0) v++;
        if(i<=v) i=v+1;
        if(hc[i]>=hc[v]){
            cz+=hc[v];
            hc[v]=0;
        }
        else{
            cz+=hc[i];
            hc[v]-=hc[i];
            i++;
        }
    }
    cout<<n-cz;
    return 0;
}
